package com.zhouyibike.uu.ui.activity.mybike.Twentyoffer;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.NetworkPolicy;
import com.squareup.picasso.Picasso;
import com.zhouyibike.uu.R;
import com.zhouyibike.uu.entity.TwentyActivityResult;
import com.zhouyibike.uu.ui.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

public class Buy20SuccessActivity extends BaseActivity implements View.OnClickListener{
    private ImageButton mBtnBack;
    private TextView mBtnTitle;
    private TextView neirong;
    private Button btn_liyc,btn_ckye;
    private ImageView bg;
    private List<TwentyActivityResult.DataBean.ImagesBean> imagesBeen = new ArrayList<>();
    private String str="<font color='#ff5237'>恭喜您已成功抢订，您可立即享受价值</font><br/><font color='#53b0ff'>100元</font><font color='#ff5237'>的三年免费骑行特权（</font></font><font color='#53b0ff'>1080元骑行券</font><font color='#ff5237'>）<br/>“</font><font color='#53b0ff'>领取单车</font><font color='#ff5237'>”功能稍后将在我的单车页面上线<br/>感谢您的支持，敬请期待~</font>";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_buy20success);
        initView();
        imagesBeen = (List<TwentyActivityResult.DataBean.ImagesBean>) getIntent().getSerializableExtra("chong20");
        try {
            if (imagesBeen != null && imagesBeen.size() > 0) {
                Picasso.with(mActivity).load(imagesBeen.get(3).getImagePath()) .networkPolicy(NetworkPolicy.NO_CACHE,NetworkPolicy.NO_STORE).into(bg);
            }
        } catch (Exception e) {
          toastShow("未获取到活动信息");
        }
    }
    private void initView() {
        mBtnBack = (ImageButton) findViewById(R.id.bar_btn_back);
        mBtnTitle = (TextView) findViewById(R.id.bar_text_title);
        bg= (ImageView) findViewById(R.id.bg);
//        neirong= (TextView) findViewById(R.id.neirong);
//        neirong.setText(Html.fromHtml(str));
        mBtnTitle.setText("抢购成功");
        mBtnBack.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bar_btn_back:
                finish();
                break;
        }
    }
}
